<template>
    <el-dialog :close-on-click-modal="false"  ref="dialogform" :title="title" :visible.sync="dialogVisible" width="70%" :before-close="handleClose">
        <el-table :data="batchInfo" v-show="batchInfoFlag == 'realities'" style="width: 100%" border>
            <el-table-column prop="plantVarietyName" label="养殖品种">
                <template slot-scope="scope">
                    {{scope.row.plantVarietyName}}
                </template>
            </el-table-column>
            <el-table-column prop="num" label="在塘养殖数量">
                <template slot-scope="scope">
                    {{scope.row.num}}
                </template>
            </el-table-column>
            <el-table-column prop="inputNum" label="总投塘粒数">
                <template slot-scope="scope">
                    {{scope.row.inputNum}}
                </template>
            </el-table-column>
            <el-table-column prop="transferNum" label="转塘粒数">
                <template slot-scope="scope">
                    {{scope.row.transferNum}}
                </template>
            </el-table-column>
            <el-table-column prop="deadNum" label="死亡粒数(粒)">
                <template slot-scope="scope">
                    {{scope.row.deadNum}}
                </template>
            </el-table-column>
            <el-table-column prop="produceNum" label="产出数量">
                <template slot-scope="scope">
                    {{scope.row.produceNum||0}}
                </template>
            </el-table-column>
            <el-table-column prop="weight" label="养殖重量(斤)">
                <template slot-scope="scope">
                    {{scope.row.weight}}
                </template>
            </el-table-column>
        </el-table>
        <el-table :data="batchInfo" v-show="batchInfoFlag == 'objectives'" style="width: 100%" border>
            <template><el-table-column prop="plantVarietyName" label="养殖品种">
                </el-table-column>
                <el-table-column prop="num" label="养殖目标粒数">
                </el-table-column>
                <el-table-column prop="weight" label="养殖目标产量(斤)">
                </el-table-column>
            </template>
        </el-table>
        <span slot="footer" class="dialog-footer">
            <el-button @click="cancel">关 闭</el-button>
        </span>
    </el-dialog>
</template>
<script>
export default {
    components: {},
    props: {
        batchInfoFlag: {
            type: String,
            default: () => {
                return ''
            }
        },
        addEditFlag: {
            type: String,
            default: () => {
                return 'add'
            }
        },
        batchInfo: {
            type: Array,
            default: () => {
                return []
            }
        },
        title: {
            type: String,
            default: () => {
                return '操作表单'
            }
        },
        dialogVisible: {
            type: Boolean,
            default: () => {
                return false
            }
        },
        batchId: null,
    },
    data() {
        return {
            addEditApi: '',
            ruleForm: {},
            rules: {
                item1: [
                    { required: true, message: '请输入批次名称', trigger: 'change' }
                ],
                item2: [
                    { required: true, message: '请选择养殖设施', trigger: 'change' }
                ]
            }
        }
    },
    computed: {

    },
    watch: {},

    mounted() { },
    methods: {
        //取消关闭
        cancel() {
            this.$emit("closeDialog")
        },
        handleClose(done) {
            this.$confirm('确认关闭？')
                .then(_ => { this.cancel() })
                .catch(_ => { });
        }
    }
};
</script>
<style lang="scss" scoped>
.btn {
    padding: 0 5px;
}
</style>